#include<iostream>
#include<cstdlib>
using namespace std;
const int N = 1e3;
char arr[N];
int main()
{
	while (fgets(arr, 100, stdin)) {
		int count = 0;
		getchar();
		for (int i = 0; arr[i] != '\0'; i++) {
			if (arr[i] == ' ') {
				count++;
		    }
			if (arr[i] == '#') {
				break;
			}
		}
		cout << count + 1 << endl;
	}
	
	return 0;
}